package blue.qingyu.whimurmur.messageEx.service.provider;

import com.jfinal.plugin.activerecord.Page;

import blue.qingyu.whimurmur.messageEx.model.WMPostClass;
import blue.qingyu.whimurmur.messageEx.service.WMPostClassService;
import io.jboot.aop.annotation.Bean;
import io.jboot.db.model.Columns;
import io.jboot.service.JbootServiceBase;
import io.jpress.commons.utils.SqlUtils;

@Bean
public class WMPostClassServiceProvider extends JbootServiceBase<WMPostClass> implements WMPostClassService{

	@Override
	public boolean deleteByIds(Object... ids) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public Page<WMPostClass> _paginate(int page, int pagesize, Columns columns) {
		StringBuilder sqlBuilder = new StringBuilder("from `ex_post_class` epc ");

        sqlBuilder.append(SqlUtils.toWhereSql(columns));
        sqlBuilder.append(" order by epc.id desc");
System.out.println("select epc.*  "+ sqlBuilder.toString());
        return DAO.paginate(page, pagesize, "select epc.*  ", sqlBuilder.toString(), columns.getValueArray());
	}

}
